package baseTest.java8;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * ClassName:Java8 <br/>
 * description:  <br/>
 * Date:     2019/6/18、17:52 <br/>
 *
 * @author Plank
 */
public class Java8 {
    public static void main(String[] args) {
       /* List<Integer> list= Stream.of(1, 2, 3).filter(item -> item >= 2).collect(Collectors.toList());
        list.forEach(System.out::println);


        IntStream.of(new int[]{1, 2, 3}).forEach(System.out::println);
        IntStream.range(1, 3).forEach(System.out::println);
        IntStream.rangeClosed(1, 3).forEach(System.out::println);*/


        Stream<List<Integer>> inputStream = Stream.of(
                Arrays.asList(1),
                Arrays.asList(2, 3),
                Arrays.asList(4, 5, 6)
        );

        Stream<Integer> outputStream = inputStream.
                flatMap((childList) -> childList.stream());
        outputStream.forEach(System.out::print);
    }
}
